package start;

import java.sql.Types;

import java.util.Date;

import javax.sql.DataSource;

import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.object.SqlUpdate;

public class UpdateActorBirthName extends SqlUpdate {

    public UpdateActorBirthName(DataSource dataSource) {
        setDataSource(dataSource);
        setSql("update t_actor set birth_date = ? where id = ?");
        declareParameter(new SqlParameter("birth_date", Types.DATE));
        declareParameter(new SqlParameter("id", Types.NUMERIC));
        compile();
    }

    public int execute(int id, Date birth_date) {
        return update(birth_date, id);
    }
}
